<?php

namespace App\Http\Controllers\Front;

use App\Http\Controllers\Controller;
use App\Model\Admin\Product;
use Illuminate\Http\Request;

class SearchController extends Controller
{
    public function index(Request $request)
    {
        $keyword = $request->q;
        $products = Product::where('pro_name', 'like', '%'.$keyword.'%')->paginate(10);
        return view('front.categori', compact('products'))->withKeyword($keyword)->withCatename('');
    }
}
